﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="EditTeam.aspx.cs" Inherits="App.EditTeam" Theme="Alpha" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
        <h1>Editace týmu</h1>
        <asp:Label ID="Label3" runat="server" CssClass="formMessage" Visible="False"></asp:Label>
        <div class="formField">
            <asp:Label ID="Label1" runat="server" Text="Název týmu: " />
            <asp:TextBox ID="TextBoxTeamName" runat="server" 
                ValidationGroup="EditTeamValidation" MaxLength="50" />
        </div>
        <asp:Label ID="LabelErrorMessage" runat="server" 
            Text="Tento název nelze použít, protože je již obsazen. Zvolte si prosím jiný název týmu." Visible="False" EnableTheming="False" CssClass="formError"></asp:Label>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="TextBoxTeamName" ErrorMessage="Je potřeba zadat název týmu" 
            ValidationGroup="EditTeamValidation" />
        <div class="formField">
            <asp:Label ID="Label2" runat="server" Text="Místo působení: " />
            <asp:TextBox ID="TextBoxLocation" runat="server" MaxLength="50" />
        </div>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="TextBoxLocation" 
            ErrorMessage="Je potřeba zadat místo působení týmu" 
            ValidationGroup="EditTeamValidation" />
         <div class="formField"> 
            <asp:Label ID="Label6" runat="server" Text="Avatar týmu URL:"></asp:Label>
            <asp:TextBox ID="TextBoxTeamAvatarURL" runat="server"  MaxLength="200"></asp:TextBox>
        </div>
        <div class="formTextarea">
            <asp:Label ID="Label4" runat="server" Text="Popis týmu:"></asp:Label>
            <asp:TextBox ID="TextBoxDescription" runat="server" MaxLength="500" 
                TextMode="MultiLine"></asp:TextBox>
        </div>
          <asp:RegularExpressionValidator ID="regComments" runat="server" ControlToValidate="TextBoxDescription"
                ValidationExpression="^[\s\S]{0,500}$" 
            ErrorMessage="Informace o týmu mohou obsahovat pouze 500 znaků." 
            ValidationGroup="EditTeamValidation"></asp:RegularExpressionValidator>
        <div class="formButton">
            <asp:Button ID="ButtonEditTeam" runat="server" onclick="ButtonEditTeam_Click" 
                Text="Uložit" ValidationGroup="EditTeamValidation" />
        </div>

        <asp:Repeater ID="RepeaterRole" runat="server">
            <HeaderTemplate>
            <h1 style="margin-top: 35px;">Změna role hráče</h1>
            <div class="roleHeader">
                <span class="first">Pokladník</span>
                <span>Vedoucí</span>
            </div>
            </HeaderTemplate>
            <ItemTemplate>
                <div class="roleLine">
                <ajaxToolkit:Gravatar  ID="ImageAvatar3" runat="server" DefaultImageBehavior="Identicon" Email="<%#GetMemberEmail(Container.DataItem)%>" DefaultImage="<%#GetMemberAvatar(Container.DataItem)%>" CssClass="detailTeamAvatar"/>
                <span class="nick">
                    <asp:LinkButton ID="LinkButtonUserInfo2" runat="server" CommandArgument="<%#GetMemberID(Container.DataItem)%>" OnClick="LinkButtonUserInfo_Click"><%#GetMemberNick(Container.DataItem)%></asp:LinkButton>
                </span>
                
                <span class="role">
                    <span class="yesNo">
                        <asp:Label ID="Label5" runat="server" Text="ne" Visible='<%#!(bool)Eval("IsTreasurer")%>'></asp:Label>
                        <asp:Label ID="Label14" runat="server" Text="ano" Visible='<%#(bool)Eval("IsTreasurer")%>'></asp:Label>
                    </span>
                    <span class="change">
                        <asp:LinkButton ID="LinkButton1" runat="server" Visible='<%#!(bool)Eval("IsTreasurer")%>' CommandArgument='<%#Eval("UserID")%>' OnClick="ConfirmTreasurer_Click">(Povýšit)</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton2" runat="server" Visible='<%#(bool)Eval("IsTreasurer")%>' CommandArgument='<%#Eval("UserID")%>' OnClick="RemoveTreasurer_Click">(Odebrat)</asp:LinkButton>
                    </span>
                </span>

                <span class="role">
                    <span class="yesNo">
                        <asp:Label ID="Label8" runat="server" Text="ne" Visible='<%#!(bool)Eval("IsLeader")%>'></asp:Label>
                        <asp:Label ID="Label7" runat="server" Text="ano" Visible='<%#(bool)Eval("IsLeader")%>'></asp:Label>
                    </span>
                    <span class="change">
                        <asp:LinkButton ID="LinkButton3" runat="server" Visible='<%#!(bool)Eval("IsLeader")%>' CommandArgument='<%#Eval("UserID")%>' OnClick="ConfirmLeadership_Click">(Povýšit)</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton4" runat="server" Visible='<%#(bool)Eval("IsLeader")%>' CommandArgument='<%#Eval("UserID")%>' OnClick="RemoveLeadership_Click" Enabled='<%#EnableToDemote()%>' CssClass='<%#EnableToDemote() ? "" : "disabled"%>' ToolTip='<%#EnableToDemote() ? "" : "Nelze odebrat, jelikož tento hráč je jediný vedoucí"%>'>(Odebrat)</asp:LinkButton>
                    </span>
                </span>
                </div>
            </ItemTemplate>
        </asp:Repeater>
    </asp:Panel>
</asp:Content>
